package com.future.cglib.v2;

import net.sf.cglib.proxy.Enhancer;

/**
 * Description:
 *
 * @author weiruibai.vendor
 * Date: 2021/9/8 15:21
 */
public class BookServiceFactory {

    public static BookServiceBean getProxyInstance(MyCglibProxy proxy) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(BookServiceBean.class);
        enhancer.setCallback(proxy);
        //   生成代理实例
        return (BookServiceBean) enhancer.create();
    }
}
